package jp.co.sn.mml.pojo.tmhkhg;

import jp.co.sn.mml.pojo.tmitem.Tmitem;

public class TmhkhgId implements java.io.Serializable { 

	//項目コード
	private Tmitem itemCd;
	//雛形コード
	private String hgCd;

	/** default constructor */
	public TmhkhgId(){

	}

	/** full constructor */
	public TmhkhgId(Tmitem itemCd,String hgCd){
		this.itemCd = itemCd;
		this.hgCd = hgCd;
	}

	//Property accessors
	public Tmitem getItemCd(){
		return this.itemCd;
	}

	public void setItemCd(Tmitem itemCd){
		this.itemCd=itemCd;
	}

	public String getHgCd(){
		return this.hgCd;
	}

	public void setHgCd(String hgCd){
		this.hgCd=hgCd;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TmhkhgId))
			return false;

		TmhkhgId castOther = (TmhkhgId) other;

		return ((this.getItemCd() ==  castOther.getItemCd())
				||(this.getItemCd()!=null && castOther.getItemCd() !=null 
					&& castOther.getItemCd() !=null 
					&& this.getItemCd().equals(castOther.getItemCd())))
			&& ((this.getHgCd() ==  castOther.getHgCd())
				||(this.getHgCd()!=null && castOther.getHgCd() !=null 
					&& castOther.getHgCd() !=null 
					&& this.getHgCd().equals(castOther.getHgCd())))
;	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getItemCd() == null ? 0 : this.getItemCd().hashCode());
		result = 37 * result
				+ (getHgCd() == null ? 0 : this.getHgCd().hashCode());
		return result;
	}

}